The present invention relates to a method for managing a memory, and to a memory controller.
Solid state memory devices encompass rewritable non-volatile memory devices which may use electronic circuitry for storing data. Currently, solid state memory devices start replacing conventional storage devices such as hard disk drives and optical disk drives in some arenas, such as in mass storage applications for laptops or desktops. Solid state memory devices are also investigated for replacing conventional storage devices in other areas such as in enterprise storage systems. This is because solid state memory devices offer exceptional bandwidth as well as excellent random I/O (input/output) performance along with an appreciated robustness due to lack of moveable parts.
However, writing data to a solid-state memory device such as a flash memory device requires paying attention to specifics in the flash technology: NAND flash memory is organized in pages and blocks. Multiple pages form a block. While read and write operations can be applied to pages as a smallest entity of such operation, erase operations can only be applied to entire blocks. And while in other storage technologies outdated data can simply be overwritten by up-to-date data, flash technology requires an erase operation before up-to-date data can be written to an erased block.
For the reason that in flash technology erase operations take much longer than read or write operations a writing technique called “write out of place” is applied in which new or updated data is written to some free page offered by a free page allocator instead of writing it to the same page where the outdated data resides. The page containing the outdated data is marked as invalid page.
The more data is written over time, the less free pages may be offered and new blocks may need to be reclaimed for a free block queue, i.e., a queue for providing free, i.e., erased blocks for writing new or updated data to. New free blocks need to be reclaimed from blocks filled with valid and/or invalid data. The block reclaiming process—also known as “garbage collection process”—first identifies blocks for cleaning based on a given policy. Then valid data still residing in these blocks is copied (relocated) to other blocks, and finally the blocks that now are free from valid data are erased and become available again for rewriting. Consequently, the block reclaiming process introduces additional read and write operations, the extent of which depends on the specific policy deployed as well as on system parameters.